import traceback
import sys
from gui import main

if __name__ == "__main__":
    try:
        app, window = main()
        sys.exit(app.exec())
    except Exception as e:
        print(f"Error: {str(e)}")
        # 打印详细的错误堆栈信息
        traceback.print_exc()